From: umherirrender Date: Sat, 9 Feb 2013 17:58:56 +0000 (+0100) Subject: Add some missing readonly checks: X-Git-Tag: 1.31.0-rc.0~20730^2 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=bcea44e64a61863a5579202e4ff0912af9cc2fe0;p=lhc%2Fweb%2Fwiklou.git Add some missing readonly checks: * Do not allow working on Special:EditWatchlist * Do not reset all notification markers * Do not delete expired restrictions Change-Id: I7a990c0a80b9c7a6340465dd082a110dafea8f14 --- diff --git a/includes/Title.php b/includes/Title.php index 6aa4cd2521..f59a5fcfa7 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2777,6 +2777,10 @@ class Title { * Purge expired restrictions from the page_restrictions table */ static function purgeExpiredRestrictions() { + if ( wfReadOnly() ) { + return; + } + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'page_restrictions', diff --git a/includes/User.php b/includes/User.php index a73414c9d3..c2af93cda5 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2874,6 +2874,10 @@ class User { * the next change of any watched page. */ public function clearAllNotifications() { + if ( wfReadOnly() ) { + return; + } + global $wgUseEnotif, $wgShowUpdatedMarker; if ( !$wgUseEnotif && !$wgShowUpdatedMarker ) { $this->setNewtalk( false ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 40971c78bd..7e1b44a4ad 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -77,6 +77,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { } $this->checkPermissions(); + $this->checkReadOnly(); $this->outputHeader();